package Data.Operation.Management;

import java.util.ArrayList;

import Data.UserList;
import Data.Shopuser.User;

public class UserListManagement {
    UserList users;
	
	public UserListManagement(){
	}
	
	public UserListManagement(UserList users){
		this.users=users;
	}
	
	
	public User findUser(String id){
		User user = null;
			for(User tempuser:users.get()){
				if(tempuser.getid().equals(id)){
					user=tempuser;
					break;
				}
				
			}
			return user;
			
		 }
	
	
    public User checkUser(String id,String password){
    	User user = null;
			for(User tempuser:users.get()){
				if((tempuser.getid().equals(id))&&(tempuser.getpassword().equals(password))){
					user=tempuser;
					break;
				}
				
			}
			return user;
    }

}
